package cn.ad.server.domain.ad;

import java.io.Serializable;
import java.util.Date;

public class StrategyUserDmpMap implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -2529814113480587102L;
	static final String VERSION = "0";
	static final String CACHE_NAME = "strategyuserdmpmap";

	private long id;
	private long strategyId;
	private long userDmpId;
	private int channelId;
	private int status;
	private Date createTime;
	private Date updateTime;

	
	public static String cacheKey(long strategyId, int channelId) {
		return new StringBuilder(CACHE_NAME).append(":").append(VERSION).append(":").append(generateCompsiteKey(strategyId, channelId)).toString();
	}
	
	public static String cacheKey(String compsiteKey) {
		return new StringBuilder(CACHE_NAME).append(":").append(VERSION).append(":").append(compsiteKey).toString();
	}

	public String toCacheKey() {
		return new StringBuilder(CACHE_NAME).append(":").append(VERSION).append(":").append(getCompsiteKey()).toString();
	}
	/**
	 * 生成组合key
	 * @param strategyId
	 * @param channelId
	 * @return
	 */
	public static String generateCompsiteKey(long strategyId, int channelId){
		return "s."+strategyId+".c."+channelId;
	}
	
	/**
	 * 获得组合key
	 * @return
	 */
	public String getCompsiteKey(){
		return "s."+strategyId+".c."+channelId;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public long getStrategyId() {
		return strategyId;
	}

	public void setStrategyId(long strategyId) {
		this.strategyId = strategyId;
	}

	public long getUserDmpId() {
		return userDmpId;
	}

	public void setUserDmpId(long userDmpId) {
		this.userDmpId = userDmpId;
	}

	public int getChannelId() {
		return channelId;
	}

	public void setChannelId(int channelId) {
		this.channelId = channelId;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	
}
